From: Kalev Lember Date: Thu, 9 Feb 2012 13:12:22 +0000 (+0200) Subject: win32: Don't crash when installed in a top-level directory X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~39^2~18132 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b21dd67d60b16101c24a67c9a7e82ff22adc45a6;p=gtk%2B3.0.git win32: Don't crash when installed in a top-level directory Avoid NULL-pointer dereference when package installation directory doesn't contain any slashes. Reported by Paweł Forysiuk. --- diff --git a/gtk/gtkwin32.c b/gtk/gtkwin32.c index b582942a7e..e9ba709d87 100644 --- a/gtk/gtkwin32.c +++ b/gtk/gtkwin32.c @@ -59,7 +59,8 @@ _gtk_get_libdir (void) { gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll); gchar *slash = strrchr (root, '\\'); - if (g_ascii_strcasecmp (slash + 1, ".libs") == 0) + if (slash != NULL && + g_ascii_strcasecmp (slash + 1, ".libs") == 0) gtk_libdir = GTK_LIBDIR; else gtk_libdir = g_build_filename (root, "lib", NULL);